let arrayProto = Array.prototype;

let arrayMethods = Object.create(arrayProto);

let methodsToPatch = [
    "push",
    "pop",
    "shift",
    "unshift",
    "splice",
    "sort",
    "reverse",
]

methodsToPatch.forEach(method => {
    arrayMethods[method] = function(...args) {
        arrayProto[method].call(this, ...args);
    }
})

export default arrayMethods;